import 'package:flutter/material.dart';
import '../util/ui_data.dart';

class GradientButton extends StatelessWidget {
  final GestureTapCallback onPressed;
  final String text;
  final Color splashColor;
  GradientButton({@required this.onPressed, @required this.text, @required this.splashColor});

  @override
  Widget build(BuildContext context) {
    return Material(
      elevation: 10.0,
      color: Colors.transparent,
      shape: const StadiumBorder(),
      child: InkWell(
        onTap: onPressed,
        splashColor: splashColor,
        borderRadius: new BorderRadius.circular(25.0),
        child: Ink(
          height: 50.0,
          decoration: BoxDecoration(
            borderRadius: new BorderRadius.circular(25.0),
            gradient: LinearGradient(
              colors: UIData.kitGradients,
            ),
          ),
          child: Center(
            child: Text(
              text,
              textAlign: TextAlign.center,
              style: TextStyle(
                color: Colors.white,
                fontWeight: FontWeight.normal,
                fontSize: 20.0,
              ),
            ),
          ),
        ),
      ),
    );
  }
}
